public class MissionTargetKillPlayer : MissionTargetBase
{
	private void OnDisable()
	{
		if (curParametr.isStarted)
		{
			OnStopTarget();
		}
	}

	protected override void OnShowStartMsg()
	{
		MessageManager.instance.CreateMessage(base.messageStart, IdClForMsg.levelUp, TypeAnimMessage.longTimeMessage, 5f);
	}

	protected override bool OnStartTarget()
	{
		if (!base.OnStartTarget())
		{
			return false;
		}
		ManagerMissions.killPlayer += OnKillPlayer;
		return true;
	}

	public override void OnStopTarget()
	{
		base.OnStopTarget();
		ManagerMissions.killPlayer -= OnKillPlayer;
	}

	private void OnKillPlayer()
	{
		if (!curParametr.isComplete)
		{
			curCountTarget++;
			curParametr.UpdateValue();
			if (TargetIsComplete())
			{
				CompleteTarget();
			}
		}
	}
}
